cmake_minimum_required(VERSION 3.10.1)

project(main)

# 让生成的可执行文件拥有符号表，可以gdb调试
add_definitions("-Wall -g")

set(LIBRTMP_DIR ${PROJECT_SOURCE_DIR}/librtmp)

aux_source_directory(librtmp LIBRTMP_SRC)
aux_source_directory(src SRC)

# 指定头文件目录
include_directories(   
    ${PROJECT_SOURCE_DIR}/include
    ${LIBRTMP_DIR}
)

# 指定动态库路径
link_directories(   
    # /usr/lib/x86_64-linux-gnu # libz.so 动态库
    /usr/local/openssl/lib      # libssl.so libcrypto.so 动态库
)

# message(${PROJECT_SOURCE_DIR}/include)
# message(${PROJECT_SOURCE_DIR})
# message(${SRC})

add_library(rtmp SHARED ${LIBRTMP_SRC})

add_executable(${PROJECT_NAME} main.cpp ${SRC})

# 链接指定动态库
target_link_libraries(${PROJECT_NAME} rtmp)

target_link_libraries(${PROJECT_NAME} -lcrypto -lssl)

target_link_libraries(${PROJECT_NAME} -lz)
